cmake_minimum_required(VERSION 3.0.0)
project(Snape VERSION 0.1.0)

set(RUNCMD ./${PROJECT_NAME})

add_executable(${PROJECT_NAME} main.cpp)
add_custom_target(run COMMAND ${RUNCMD} DEPENDS ${PROJECT_NAME})
add_custom_target(debug COMMAND gdb --args ${RUNCMD} DEPENDS ${PROJECT_NAME})

set(CMAKE_CXX_COMPILER "g++")

set(EGE_INSTALL_PATH ExternalLibs/EGE20.08)
include_directories(${EGE_INSALL_PATH} /include/)
set(CMAKE_LIBRARY_PATH ${EGE_INSALL_PATH} /lib/mingw64)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${OPENCV_LIBS})

IF(NOT CMAKE_BUILD_TYPE STREQUAL Release)
    ADD_DEFINITIONS(-D_DEBUG)
    set(CMAKE_CXX_FLAGS "-g ${CMAKE_CXX_FLAGS}")
ENDIF()